@extends('admin.layout')
@section('title',$title)
@section('content')
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                用户管理
                <small>在这里，你可以添加用户</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/admin/index')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="{{ url('/admin/user/add')}}">用户管理</a></li>
                <li class="active">用户添加</li>
            </ol>
        </section>  

        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速添加用户</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/user/insert') }}" method="post" enctype="multipart/form-data">
                        {{ csrf_field() }}
                            <div class="box-body">
                                @if (count($errors) > 0)
                                    <div class="alert alert-danger">
                                        <ul>
                                            @foreach ($errors->all() as $error)
                                                <li>{{ $error }}</li>
                                            @endforeach
                                        </ul>
                                    </div>
                                @endif
                                <div class="form-group">
                                    <label for="exampleInputEmail1">用户名</label>
                                    <input type="text" class="form-control" id="exampleInputEmail1" name="uname" 
                                           placeholder="请输入用户名" value="{{old('uname')}}">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputPassword1">密码</label>
                                    <input type="password" class="form-control" id="exampleInputPassword1" name="upwd"
                                           placeholder="请输入密码" value="{{old('upwd')}}">
                                </div>
                                 <div class="form-group">
                                    <label for="exampleInputPassword1">确认密码</label>
                                    <input type="password" class="form-control" id="exampleInputPassword1" name="pepwd"
                                           placeholder="请输入确认密码" value="{{old('pepwd')}}">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">手机号</label>
                                    <input type="number" class="form-control" id="exampleInputEmail1" name="tel"
                                           placeholder="请输入手机号" value="{{old('tel')}}>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">邮箱</label>
                                    <input type="email" class="form-control" id="exampleInputEmail1" name="email"
                                           placeholder="请输入邮箱" value="{{old('email')}}"">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">地址</label>
                                    <input type="text" class="form-control" id="exampleInputEmail1" name="addr"
                                           placeholder="请输入地址" value="{{old('addr')}}">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputFile">头像</label>
                                    <input name="uface" type="file" id="exampleInputFile">
                                    <p class="help-block">请上传你的头像</p>
                                </div>
                                <div class="select">
                                    <label>
                                    权限:
                                        <select name="auth" id="">
                                            <option value="0">普通用户</option>
                                            <option value="1">管理员</option>
                                            <option value="2">超级管理员</option>
                                        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    性别:    
                                        <select name="sex">
                                            <option value="w" >女</option>
                                            <option value="m" selected="m">男</option>
                                        </select>
                                    </label>
                                </div>
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </div>
                        </form>
                    </div><!-- /.box -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection